home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
TCL1
/
GRAPH_FO
/
ZOOMRECT.C
< prev
Wrap
Text File
|
1991-01-06
|
1KB
|
39 lines
/******************************************************************************
ZoomRect.c
Taken from The Essential MacTutor Vol. 3, p.140 & 614
*******************************************************************************/
ZoomRect(srect, drect, expand, delay)
Rect *srect; Rect *drect; Boolean expand; long delay; {
GrafPtr savePort, deskPort;
Rect r[17];
long unit, ticks;
int count;
PenState ps;
GetPort(&savePort);
GetWMgrPort(&deskPort);
SetPort(deskPort);
GetPenState(&ps);
PenMode(notPatXor);
PenPat(gray);
for(count = 0; count < 22; count ++) {
Delay(delay, &ticks);
if(count < 16) {
r[count] = *srect;
unit = (expand?count+1:33-count)*count/2;
r[count].top += (unit*(drect->top - srect->top))/136;
r[count].left += (unit*(drect->left - srect->left))/136;
r[count].bottom += (unit*(drect->bottom - srect->bottom))/136;
r[count].right += (unit*(drect->right - srect->right))/136;
FrameRect(&r[count]);
}
if(count >= 6)
FrameRect(&r[count - 6]);
}
SetPenState(&ps);
SetPort(savePort);
}